package com.blank.task11;

import java.util.List;

public class addStudent {
    public static void add(int stuNum, String name, int age, List<Student> studentList){
        Student stu = new Student(stuNum,name,age);
        boolean flag = studentList.contains(stu);
        if(flag){
            System.out.println("该学生已经存在，请重新添加！");
        }else{
            studentList.add(stu);
            System.out.println("添加成功！");
        }
    }
}
